

export function addHeaders(input: RequestInfo | URL, init?: RequestInit): { input: RequestInfo | URL, init?: RequestInit } {

    if (!(init?.headers && (init.headers as Record<string, string>)['Content-Type'])) {
        init = {
            ...init,
            headers: {
                ...init?.headers,
                'Content-Type': 'application/json',
            }
        }
    }

    return { input, init }
}